import { defineStore } from 'pinia';
import { ref } from 'vue';
import type { ThemeConfig } from '@/types';

export const useAppStore = defineStore('app', () => {
  const theme = ref<ThemeConfig>({
    primaryColor: '#409EFF',
    textColor: '#303133',
    backgroundColor: '#ffffff',
  });

  const loading = ref(false);

  const setTheme = (newTheme: Partial<ThemeConfig>) => {
    theme.value = { ...theme.value, ...newTheme };
  };

  const setLoading = (status: boolean) => {
    loading.value = status;
  };

  return {
    theme,
    loading,
    setTheme,
    setLoading,
  };
}); 